package ModelLayer;

import java.util.Date;


/**
 * The class Rental represents a rentalagreament
 * 
 * @author Group 4, dm82
 * @version 06-12-12
 */
public class Rental
{
    private long            id;
    private Customer        customer;
    private Employee        employee;
    private Tool            tool;
    private ToolDescription toolDescription;
    private Date            startDate,
                            endDate,
                            toStartDate,
                            toEndDate,
                            reservationDate;
    private int             status;
    public static final int     RESERVED = 0,
                                RENTED = 1,
                                RETURNED = 2;
    /**
     * Constructor for objects of class Rental
     * 
     * @param   id          The persons id, as a long
     * @param   costumer    The costumer renting the tool, as a Costumer
     * @param   employee    The employee who facilitated the rental, as an Emplyee
     * @param   tool        The tool that is being rentet, as a Tool
     * @param   startDate   The date on wich the rentalperiod is to begin, as a Date
     * @param   endDate     The date on wich the rentalperiod is to end, as a Date
     */
    public Rental(long id, Customer customer, Employee employee, ToolDescription toolDescription, Date toStartDate, Date toEndDate, Date reservationDate, int status)
    {
        this.id = id;
        this.customer = customer;
        this.employee = employee;
        this.toolDescription = toolDescription;
        this.toStartDate = toStartDate;
        this.toEndDate = toEndDate;
        this.reservationDate = reservationDate;
        this.status = status;
    }
    
    /**
     * This method returns this rentals id
     * 
     * @return  The id of this person. As a long.
     */
    public long getID(){return id;}
    
    /**
     * This method returns costumer of this rental.
     * 
     * @return  The costumer. As a Costumer
     */
    public Customer getCustomer(){return customer;}
    
    /**
     * This method returns the employee who facilitatet this rental
     * 
     * @return  The employee. As an Employee.
     */
    public Employee getEmployee(){return employee;}
    
    /**
     * This method returns the tool that is being rented.
     * 
     * @return  The tool. As a Tool.
     */
    public Tool getTool(){return tool;}
    
    /**
     * This method returns the tool description of the reserved tool.
     * 
     * @return  The tool description. As a ToolDescription.
     */
    public ToolDescription getToolDescription(){return toolDescription;}
    
    /**
     * This method returns the start date of this rental.
     * 
     * @return  The start date. As a Date.
     */
    public Date getStartDate(){return startDate;}
    
    /**
     * This method returns the end date of this rental.
     * 
     * @return  The end date. As a Date.
     */
    public Date getEndDate(){return endDate;}
    
    /**
     * This method returns the proposed start date of this rental.
     * 
     * @return  The start date. As a Date.
     */
    public Date getToStartDate(){return toStartDate;}
    
    /**
     * This method returns the proposed end date of this rental.
     * 
     * @return  The end date. As a Date.
     */
    public Date getToEndDate(){return toEndDate;}
    
    /**
     * This method returns the reservation date.
     * 
     * @return  The reservation date. As a Date.
     */
    public Date getReservationDate()
    {
        return reservationDate;
    }
    
    /**
     * This method changes costumer of this rental.
     * 
     * @param  The costumer. As a Costumer
     */
    public void setCustomer(Customer customer){this.customer = customer;}
    
    /**
     * This method changes the employee who facilitatet this rental
     * 
     * @param  The employee. As an Employee.
     */
    public void setEmployee(Employee employee){this.employee = employee;}
    
    /**
     * This method changes the tool that is being rented.
     * 
     * @param  The tool. As a Tool.
     */
    public void setTool(Tool tool){this.tool = tool;}
    
    /**
     * This method changes the tool description of the reserved tool.
     * 
     * @param  The tool description. As a ToolDescription.
     */
    public void setToolDescription(ToolDescription toolDescription){this.toolDescription = toolDescription;}
    
    /**
     * This method changes the start date of this rental.
     * 
     * @param  The start date. As a Date.
     */
    public void setStartDate(Date startDate){this.startDate = startDate;}
    
    /**
     * This method changes the end date of this rental.
     * 
     * @param  The end date. As a Date.
     */
    public void setEndDate(Date endDate){this.endDate = endDate;}
    
    /**
     * This method changes the proposed start date of this rental.
     * 
     * @param  The start date. As a Date.
     */
    public void setToStartDate(Date toStartDate){this.toStartDate = toStartDate;}
    
    /**
     * This method changes the proposed end date of this rental.
     * 
     * @param  The end date. As a Date.
     */
    public void setToEndDate(Date toEndDate){this.toEndDate = toEndDate;}
    
    /**
     * This method changes the status of this rental.
     * 
     * @param  status   The status. As a int.
     */
    public void setStatus(int status){this.status = status;}
}
